/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.skatiger.jrove.renderer;

public interface Html {

    // Common attributes
    String ALIGN_ATTR = "align";
    String BORDER_ATTR = "border";
    String WIDTH_ATTR = "width";
    String READONLY_ATTR = "readonly";
    String FILE_ATTR = "file";
    String ACCEPT_ATTR = "accept";

    // Common event handler attributes
    String ONCLICK_ATTR = "onclick";
    String ONDBLCLICK_ATTR = "ondblclick";
    String ONMOUSEDOWN_ATTR = "onmousedown";
    String ONMOUSEUP_ATTR = "onmouseup";
    String ONMOUSEOVER_ATTR = "onmouseover";
    String ONMOUSEMOVE_ATTR = "onmousemove";
    String ONMOUSEOUT_ATTR = "onmouseout";
    String ONKEYPRESS_ATTR = "onkeypress";
    String ONKEYDOWN_ATTR = "onkeydown";
    String ONKEYUP_ATTR = "onkeyup";
    String ONFOCUS_ATTR = "onfocus";
    String ONBLUR_ATTR = "onblur";
    // Input field event handler attributes
    String ONSELECT_ATTR = "onselect";
    String ONCHANGE_ATTR = "onchange";

    // universal attributes
    String DIR_ATTR = "dir";
    String LANG_ATTR = "lang";
    String STYLE_ATTR = "style";
    String TITLE_ATTR = "title";

    // universal, but not the same property-name - styleClass attribute is rendered as such
    String CLASS_ATTR = "class";

    // common form field attributes
    String ACCESSKEY_ATTR = "accesskey";
    String TABINDEX_ATTR = "tabindex";
    String DISABLED_ATTR = "disabled";

    // <a>
    String TARGET_ATTR = "target"; // used by <a> and <form>
    String CHARSET_ATTR = "charset";
    String COORDS_ATTR = "coords";
    String HREF_ATTR = "href";
    String HREFLANG_ATTR = "hreflang";
    String REL_ATTR = "rel";
    String REV_ATTR = "rev";
    String SHAPE_ATTR = "shape";
    String TYPE_ATTR = "type";

    // <form>
    String ACCEPT_CHARSET_ATTR = "accept-charset";
    String ENCTYPE_ATTR = "enctype";
    String ONRESET_ATTR = "onreset";
    String ONSUBMIT_ATTR = "onsubmit";
    String FORM_METHOD_GET = "get";
    String FORM_METHOD_POST = "post";
    String FORM_METHOD_PUT = "put";
    String FORM_METHOD_DELETE = "delete";
    // <img>
    String SRC_ATTR = "src";
    String ALT_ATTR = "alt";
    String HEIGHT_ATTR = "height";
    String HSPACE_ATTR = "hspace";
    String ISMAP_ATTR = "ismap";
    String LONGDESC_ATTR = "longdesc";
    String USEMAP_ATTR = "usemap";
    String VSPACE_ATTR = "vspace";
    String ONABORT_ATTR = "onabort";

    // <input>
    String SIZE_ATTR = "size";
    String AUTOCOMPLETE_ATTR = "autocomplete";
    String CHECKED_ATTR = "checked";
    String MAXLENGTH_ATTR = "maxlength";

    // values for input-type attribute
    String INPUT_TYPE_SUBMIT = "submit";
    String INPUT_TYPE_IMAGE = "image";
    String INPUT_TYPE_HIDDEN = "hidden";
    String INPUT_TYPE_CHECKBOX = "checkbox";
    String INPUT_TYPE_PASSWORD = "password";
    String INPUT_TYPE_TEXT = "text";
    String INPUT_TYPE_RADIO = "radio";
    String INPUT_TYPE_BUTTON = "button";

    // <iframe>
    String FRAMEBORDER_ATTR = "frameborder";
    String SCROLLING_ATTR = "scrolling";

    // <label>
    String FOR_ATTR = "for";

    // <select>
    String MULTIPLE_ATTR = "multiple";

    // <table>
    String BGCOLOR_ATTR = "bgcolor";
    String CELLPADDING_ATTR = "cellpadding";
    String CELLSPACING_ATTR = "cellspacing";
    String FRAME_ATTR = "frame";
    String RULES_ATTR = "rules";
    String SUMMARY_ATTR = "summary";
    // <td> and <th>
    // <textarea>
    String COLS_ATTR = "cols";
    String ROWS_ATTR = "rows";
    String WRAP_ATTR = "wrap";

    // body
    String BODY_ELEM = "body";
    String BODY_TARGET = BODY_ELEM;
    String PARA_ELEM = "p";
    String ONLOAD_ATTR = "onload";
    String ONUNLOAD_ATTR = "onload";
    String ALINK_ATTR = "alink";
    String VLINK_ATTR = "vlink";
    String LINK_ATTR = "link";
    String TEXT_ATTR = "text";
    String BACKGROUND_ATTR = "background";
    // HTML attributes needed for renderding only
    String ID_ATTR = "id";
    String NAME_ATTR = "name";
    String VALUE_ATTR = "value";
    String METHOD_ATTR = "method";
    String ACTION_ATTR = "action";
    String COLSPAN_ATTR = "colspan";
    String ROWSPAN_ATTR = "rowspan";
    String SCOPE_ATTR = "scope";
    String LABEL_ATTR = "label";
    String SELECTED_ATTR = "selected";
    // area attributes
    String NOHREF_ATTR = "nohref";
    //col attributes
    String CHAR_ATTR = "char";
    String CHAROFF_ATTR = "charoff";
    String SPAN_ATTR = "span";
    String VALIGN_ATTR = "valign";
    //iframe attributes 
    String MARGINHEIGHT_ATTR = "marginheight";
    String MARGINWIDTH_ATTR = "marginwidth";
    // HTML attributes values
    String SCOPE_COLGROUP_VALUE = "colgroup";
    String SCOPE_ROW_VALUE = "row";

    // HTML element constants
    String SPAN_ELEM = "span";
    String DIV_ELEM = "div";
    String INPUT_ELEM = "input";
    String BUTTON_ELEM = "button";
    String SELECT_ELEM = "select";
    String OPTION_ELEM = "option";
    String OPTGROUP_ELEM = "optgroup";
    String TEXTAREA_ELEM = "textarea";
    String FORM_ELEM = "form";
    String ANCHOR_ELEM = "a";
    String H1_ELEM = "h1";
    String H2_ELEM = "h2";
    String H3_ELEM = "h3";
    String H4_ELEM = "h4";
    String H5_ELEM = "h5";
    String H6_ELEM = "h6";
    String IFRAME_ELEM = "iframe";
    String IMG_ELEM = "img";
    String LABEL_ELEM = "label";
    String TABLE_ELEM = "table";
    String CAPTION_ELEM = "caption";
    String TR_ELEM = "tr";
    String TH_ELEM = "th";
    String TD_ELEM = "td";
    String TBODY_ELEM = "tbody";
    String TFOOT_ELEM = "tfoot";
    String THEAD_ELEM = "thead";
    String STYLE_ELEM = "style";
    String SCRIPT_ELEM = "script";
    String SCRIPT_TYPE_ATTR = "type";
    String SCRIPT_TYPE_TEXT_JAVASCRIPT = "text/javascript";
    String STYLE_TYPE_TEXT_CSS = "text/css";
    String SCRIPT_LANGUAGE_ATTR = "language";
    String SCRIPT_LANGUAGE_JAVASCRIPT = "JavaScript";
    String SCRIPT_ELEM_DEFER_ATTR = "defer";
    String LINK_ELEM = "link";
    String STYLESHEET_VALUE = "stylesheet";
    String UL_ELEM = "ul";
    String OL_ELEM = "ol";
    String LI_ELEM = "li";
    String BLOCKQUOTE_ELEM = "blockquote";
    // HTML simple element constants
    String BR_ELEM = "br";
    String DL_ELEM = "dl";
    String DT_ELEM = "dt";
    String DD_ELEM = "dd";

    // HTML entities
    String NBSP_ENTITY = "&#160;";

    String HREF_PATH_SEPARATOR = "/";
    String HREF_PATH_FROM_PARAM_SEPARATOR = "?";

    // HREF_PARAM_SEPARATOR = "&";
    String HREF_PARAM_NAME_FROM_VALUE_SEPARATOR = "=";
    // attributes
    String[] STANDARD_ATTRIBUTES = { ID_ATTR,
                                    CLASS_ATTR,
                                    STYLE_ATTR,
                                    TITLE_ATTR,
                                    DIR_ATTR,
                                    LANG_ATTR,
                                    ACCESSKEY_ATTR,
                                    TABINDEX_ATTR };
    String[] STANDARD_ATTRIBUTES_WITHOUT_ID = { CLASS_ATTR,
                                               STYLE_ATTR,
                                               TITLE_ATTR,
                                               DIR_ATTR,
                                               LANG_ATTR,
                                               ACCESSKEY_ATTR,
                                               TABINDEX_ATTR };

    String[] STANDARD_EVENTS = {
                                // focus
                                ONBLUR_ATTR,
                                ONFOCUS_ATTR,
                                // click
                                ONCLICK_ATTR,
                                ONDBLCLICK_ATTR,
                                // mouse
                                ONMOUSEDOWN_ATTR,
                                ONMOUSEUP_ATTR,
                                ONMOUSEOVER_ATTR,
                                ONMOUSEMOVE_ATTR,
                                ONMOUSEOUT_ATTR,
                                // key
                                ONKEYPRESS_ATTR,
                                ONKEYDOWN_ATTR,
                                ONKEYUP_ATTR };

    String[] AREA_ELEM_OPTIONAL_ATTRIBUTES = { ALT_ATTR,
                                              COORDS_ATTR,
                                              HREF_ATTR,
                                              NOHREF_ATTR,
                                              SHAPE_ATTR,
                                              TARGET_ATTR };
    //ANCHOR
    String[] ANCHOR_ELEM_OPTIONAL_ATTRIBUTES_WITH_OUT_HREF = { CHARSET_ATTR,
                                                              COORDS_ATTR,
                                                              HREFLANG_ATTR,
                                                              REL_ATTR,
                                                              REV_ATTR,
                                                              SHAPE_ATTR,
                                                              TARGET_ATTR };
    String[] ANCHOR_ELEM_OPTIONAL_ATTRIBUTES = { CHARSET_ATTR,
                                                COORDS_ATTR,
                                                HREF_ATTR,
                                                HREFLANG_ATTR,
                                                REL_ATTR,
                                                REV_ATTR,
                                                SHAPE_ATTR,
                                                TARGET_ATTR };
    String[] BUTTON_ELEM_OPTIONAL_ATTRIBUTES = { DISABLED_ATTR,
                                                NAME_ATTR,
                                                TYPE_ATTR,
                                                VALUE_ATTR //button
                                                           //submit
                                                           //reset
    };

    String[] CAPTION_ELEM_OPTIONAL_ATTRIBUTES = { ALIGN_ATTR };
    String[] COL_ELEM_OPTIONAL_ATTRIBUTES = { ALIGN_ATTR,//left,
                                                         //right
                                                         //center
                                                         //justify
                                                         //char
                                             CHAR_ATTR,
                                             CHAROFF_ATTR,
                                             SPAN_ATTR,
                                             VALIGN_ATTR,//top
                                                         //middle
                                                         //bottom
                                                         //baseline
                                             WIDTH_ATTR };
    String[] FORM_ELEM_REQUIRED_ATTRIBUTES = { ACTION_ATTR };
    String[] FORM_ELEM_OPTIONAL_ATTRIBUTES = { ACCEPT_ATTR,
                                              ACCEPT_CHARSET_ATTR,
                                              ENCTYPE_ATTR,//application/x-www-form-urlencoded
                                                           //multipart/form-data
                                                           //text/plain  
                                              METHOD_ATTR,//get
                                                          //post  
                                              NAME_ATTR,
                                              TARGET_ATTR,
                                              //events
                                              ONRESET_ATTR,
                                              ONSUBMIT_ATTR };
    String[] IFRAME_ELEM_OPTIONAL_ATTRIBUTES = { FRAMEBORDER_ATTR,
                                                HEIGHT_ATTR,
                                                LONGDESC_ATTR,
                                                //marginheight
                                                //marginwidth
                                                NAME_ATTR,
                                                SCROLLING_ATTR,
                                                SRC_ATTR,
                                                WIDTH_ATTR };
    String[] IMG_ELEM_REQUIRED_ATTRIBUTES = { ALT_ATTR,
                                             SRC_ATTR };
    String[] IMG_ELEM_OPTIONAL_ATTRIBUTES = { HEIGHT_ATTR,
                                             ISMAP_ATTR,
                                             LONGDESC_ATTR,
                                             USEMAP_ATTR,
                                             WIDTH_ATTR };
    String[] INPUT_ELEM_OPTIONAL_ATTRIBUTES = { NAME_ATTR,
                                               ALT_ATTR,
                                               DISABLED_ATTR,// Specifies that an input element should be disabled when the page loads
                                               SIZE_ATTR,//   Specifies the width of an input field  
                                               TYPE_ATTR,//button
                                               //checkbox
                                               //file
                                               //hidden
                                               //image
                                               //password
                                               //radio
                                               //reset
                                               //submit
                                               //text    
                                               //events
                                               ONSELECT_ATTR };
    // INPUT
    String[] INPUT_ELEM_OPTIONAL_ATTRIBUTES_WITHOUT_NAME = { ALT_ATTR,
                                                            DISABLED_ATTR,// Specifies that an input element should be disabled when the page loads
                                                            SIZE_ATTR,//   Specifies the width of an input field  
                                                            TYPE_ATTR,//button
                                                                      //checkbox
                                                                      //file
                                                                      //hidden
                                                                      //image
                                                                      //password
                                                                      //radio
                                                                      //reset
                                                                      //submit
                                                                      //text    
                                                            //events
                                                            ONSELECT_ATTR };
    String[] INPUT_ELEM_TYPE_IMAGE_ATTRIBUTES = { SRC_ATTR };//the URL to an image to display as a submit button
    String[] INPUT_ELEM_TYPE_TEXT_ATTRIBUTES = { MAXLENGTH_ATTR,//the maximum length (in characters) of an input field (for type="text" or type="password")     
                                                READONLY_ATTR,//that an input field should be read-only (for type="text" or type="password")
                                                AUTOCOMPLETE_ATTR };

    String[] INPUT_ELEM_TYPE_FILE_ATTRIBUTES = { ACCEPT_ATTR }; // the types of files that can be submitted through a file upload (only for type="file")
    String[] INPUT_ELEM_CHEKCED_ATTRIBUTES = { CHECKED_ATTR };

    String[] LABEL_ELEM_OPTIONAL_ATTRIBUTES = { FOR_ATTR };//which form element a label is bound to
    String[] MAP_ELEM_REQUIRED_ATTRIBUTES = { NAME_ATTR };

    //optgroup
    String[] OPTGROUP_ELEM_REQUIRED_ATTRBIUTES = { LABEL_ATTR };
    String[] OPTGROUP_ELEM_OPTIONAL_ATTRBIUTES = { DISABLED_ATTR };
    //option
    String[] OPTION_ELEM_OPTIONAL_ATTRBIUTES = { DISABLED_ATTR,
                                                SELECTED_ATTR };
    //select
    String[] SELECT_ELEM_OPTIONAL_ATTRIBUTES = { DISABLED_ATTR,
                                                MULTIPLE_ATTR,
                                                NAME_ATTR,
                                                SIZE_ATTR };
    //table
    String[] TABLE_ELEM_OPTIONAL_ATTRIBUTES = { BORDER_ATTR,
                                               CELLPADDING_ATTR,
                                               CELLSPACING_ATTR,
                                               FRAME_ATTR, //which parts of the outside borders that should be visible

                                               RULES_ATTR,//   none
                                                          //groups
                                                          //rows
                                                          //cols
                                                          //all     Specifies which parts of the inside borders that should be visible
                                               SUMMARY_ATTR, //    text    Specifies a summary of the content of a table
                                               WIDTH_ATTR };
    //td
    String[] TD_ELE_OPTIONAL_ATTRIBUTES = { ALIGN_ATTR,
                                           BGCOLOR_ATTR,
                                           COLSPAN_ATTR,
                                           HEIGHT_ATTR,
                                           ROWSPAN_ATTR,
                                           WIDTH_ATTR };
    //th
    String[] TH_ELEM_OPTIONAL_ATTRIBUTES = TD_ELE_OPTIONAL_ATTRIBUTES;

    String[] TEXTAREA_ELEM_REQUIRED_ATTRIBUTES = { COLS_ATTR,
                                                  ROWS_ATTR };
    String[] TEXTAREA_ELEM_OPTIONAL_ATTRIBUTES = { DISABLED_ATTR,
                                                  NAME_ATTR,
                                                  READONLY_ATTR,
                                                  ONSELECT_ATTR };
}
